package com.sany.taskmanager.bean;

import com.sany.taskmanager.ui.adapter.BaseExpandableRecyclerViewAdapter;

import java.util.List;

public class TaskGroupBean implements BaseExpandableRecyclerViewAdapter.BaseGroupBean<TaskInfoBean> {

    private TaskInfoBean mHeaderBean;
    private List<TaskInfoBean> mList;

    public void setList(List<TaskInfoBean> list) {
        mList = list;
    }

    public List<TaskInfoBean> getList() {
        return mList;
    }

    public void setHeaderBean(TaskInfoBean headerBean) {
        mHeaderBean = headerBean;
    }

    public TaskInfoBean getHeaderBean() {
        return mHeaderBean;
    }

    @Override
    public int getChildCount() {
        return mList == null ? 0 : mList.size();
    }

    @Override
    public TaskInfoBean getChildAt(int childIndex) {
        return mList.size() <= childIndex ? null : mList.get(childIndex);
    }

    @Override
    public boolean isExpandable() {
        return getChildCount() > 0;
    }
}
